package com.design.decorator.shape;

public class DecoratorDemo {
    public static void main(String[] args) {
        // 绘制一个红色的圆形
        Shape circle = new Circle();
        ShapeDecorator redCircle = new FillColorDecorator(circle, "Red");
        redCircle.draw();
        System.out.println("Description: " + redCircle.getDescription());

        // 绘制一个蓝色的矩形，并添加虚线边框样式
        Shape rectangle = new Rectangle();
        ShapeDecorator blueDashedRectangle = new BorderStyleDecorator(new FillColorDecorator(rectangle, "Blue"), "Dashed");
        blueDashedRectangle.draw();
        System.out.println("Description: " + blueDashedRectangle.getDescription());

        // 绘制一个绿色的椭圆，并添加实线边框样式
        Shape ellipse = new Ellipse();
        ShapeDecorator greenSolidEllipse = new BorderStyleDecorator(new FillColorDecorator(ellipse, "Green"), "Solid");
        greenSolidEllipse.draw();
        System.out.println("Description: " + greenSolidEllipse.getDescription());
    }
}
